package com.ck.javacode.Chapter7;

/**
 * @author: caoke
 * @date: 2021/10/11 4:09 下午
 * @description:
 */
public class D4_MethodParameter01 {
    public static void main(String[] args) {
        /*

         */
        int a = 10;
        int b = 20;
        AAAA aaaa = new AAAA();
        aaaa.swap(a,b);
        System.out.println("主方法\ta="+a+"\tb="+b);
    }
}
class AAAA{

    public void swap(int a,int b){
        System.out.println("交换前\ta="+a+"\tb="+b);
        // 完成了a和b的交换
        int tmp = a;
        a = b;
        b = tmp;
        System.out.println("交换后\ta="+a+"\tb="+b);
    }

}